package src.itheima04;

import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;

public class B {
    public static void main(String[] args) {
        LinkedHashSet<Student> linkedList=new LinkedHashSet();
        linkedList.add(new Student("21",20));
        linkedList.add(new Student("小军子",18));
        linkedList.add(new Student("小文字",16));
        linkedList.add(new Student("小文字",16));
        linkedList.add(new Student("大亮子",17));
        linkedList.add(new Student("大亮子",17));
        linkedList.add(new Student("大欢子",19));
        linkedList.add(new Student("大欢子",19));

        Iterator<Student> iterator=linkedList.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
        System.out.println("---------------------------------");
        for (Student student : linkedList) {
            System.out.println(student);
        }
    }
}
